#include"List.h"

void Test()
{
    DLN *list=DListNodeInit(list);
    //尾插
    DListNodePushBack(list,1);
    DListNodePushBack(list,2);
    DListNodePushBack(list,3);
    DListNodePushBack(list,4);
    DListNotPrint(list);//打印
    printf("\n");
    //尾删
    DListNodePopBack(list);
    DListNotPrint(list);//打印
    printf("\n");
    //头插
    DListNodePushFront(list,0);
    DListNodePushFront(list,-1);
    DListNotPrint(list);//打印
    printf("\n");

    //头删
    DListNodePopFront(list);
    DListNotPrint(list);//打印
    printf("\n");

    //pos位删
    DLN*ret=DListNotFind(list,2);//查找
    if(ret==NULL)
    {
        printf("NULL");
    }
    else
    {
        //插
        ListInsert(ret,1104);
        DListNotPrint(list);//打印
        printf("\n");

        //删
        ListErase(ret);
        DListNotPrint(list);//打印
        printf("\n");
    }
   //制空
    DListNotNULL(&list);
    DListNotPrint(list);//打印
    printf("\n");
}
int main()
{

    Test();
    return 0;
}
